<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>    
<!DOCTYPE html>
<html>
<base href="${pageContext.request.contextPath }/">
<head>
<meta charset="UTF-8">
<title>信息修改</title>
<link rel="stylesheet" href="ht/bootstrap/css/bootstrap.min.css" />
<script type="text/javascript" src="ht/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="ht/js/xiaogemsg.js"></script>
	<script type="text/javascript" src="ht/js/mouse.js"></script>
	<style>
		body{
			margin: 0px;
			padding: 0px;
		}
		.right-shang{
			height: 160px;
			margin-top: 50px;
			text-align: center;
			border: 0px solid red;
		}
		.rignt-nav-img {
			width: 120px;
			height: 120px;
			margin-top: 3%;
			border-radius: 50%;
			text-align: center;
		}
		.top-title{
			height: 50px;
			width: 100%;
			border: 1px solid #FAEBCC;
			background-color: #FAEBCC;
			position: fixed;
		}
		.top-title-p-font{
			color: #FF8800;
			font-family: '华文行楷';
			font-size: 32px;
		}
		.bottom-xia{
			width: 100%;
			height: 640px;
			border-radius: 5px;
			border: 1px solid gainsboro;
			position: relative;
			
		}
		input{
			height:35px;
			width:100%;
			border: 0px solid red;
			border-radius: 5px;
		}
		.headrImg{
			height: 40px;
			width: 80%;
			margin-left: 10.01%;
			text-align: center;
			border: 1px solid black;
			padding:3px;
			border-bottom: 0px;
		}
	</style>
	<script type="text/javascript" src="layui/layui.js" ></script>
	<script src="ht/laydate/laydate.js"></script> <!-- 改成你的路径 -->
	<script>
	lay('#version').html('-v'+ laydate.v);
	
	//执行一个laydate实例
	laydate.render({
	  elem: '#newTime' //指定元素
	});
	</script>
	<script type="text/javascript">
		$(function(){
			
			//$("#img").attr("src","img/"+$("#oldImg").val());
			
			$("#img").click(function(){
				xiaogeImg(500, 500, $(this).attr("src"));
			});
			
			$("#cancel").click(function(){
				frmBody = parent.document.getElementById('frame-leftbody');
				frmBody.cols ="300, 10, *";
				window.history.go(-1)
			});
			
		});
	
			//$("#img").attr("src",+$("#newImg").val());
		
	</script>
	<script>
		//验证
		$(function(){
			//title
			$("#newTitle").blur(function(){
				if($(this).val()==null || $(this).val()==""){
					$(this).attr("style","border: 1px solid red;");
				}else{
					$(this).attr("style","border: 0px solid red;");
				}
			});
			
			
			//发布时间
			$("#newTime").blur(function(){
				if($(this).val()==null || $(this).val()==""){
					$(this).attr("style","border: 1px solid red;");
				}else{
					$(this).attr("style","border: 0px solid red;");
				}
			});
			//详情
			$("#newContent").blur(function(){
				alert($(this).val())
				if($(this).val()==null || $(this).val()==""){
					$(this).attr("style","border: 1px solid red;");
				}else{
					$(this).attr("style","border: 0px solid red;");
				}
			});
			
			
		});
		layui.use(['layer','form','laydate'], function(){
			$('#Cancel').click(function(){
				closeThis();
			})
			
			//关闭当前窗口
			function closeThis(){
				var index = parent.layer.getFrameIndex(window.name);
				parent.layer.close(index);
				window.document.body.innerHTML = "";
			}
		});
		
	</script>
	</head>
<body>
	<div class="bottom-xia">
		<form id="ff" action="newsaction!upda.action" method="post" enctype="multipart/form-data">
			<input type="hidden" name="news.newId" value="${news.newId }">
			<table align="center" cellpadding="3" cellspacing="3" width="80%">
				<tr height="40px">
					<th style="font-size: 14px;">
						标&nbsp;题：
					</th>
					<td>
						<span  style="font-size: 12px;">
							<input type="text" placeholder="*请输入标题" value="${news.newTitle }"  id="newTitle" name="news.newTitle">
						</span>
					</td>					
				</tr>				
				<tr height="40px">
					<th style="font-size: 14px;">
						类&nbsp;&nbsp;型：
					</th>
					<td>
					<c:if test="${news.newType==0 }">
						<span  style="font-size: 12px;">
							<input type="radio" id="newType" value="0" checked="checked" name="news.newType" style="width: 30%;height: 15px;">汽车保养
							<input type="radio" id="newType" value="1" name="news.newType" style="width: 30%;height: 15px;">行业新闻
						</span>
					</c:if>
					<c:if test="${news.newType==1 }">
						<span  style="font-size: 12px;">
							<input type="radio" id="newType" value="0" name="news.newType" style="width: 30%;height: 15px;">汽车保养
							<input type="radio" id="newType" value="1" checked="checked" name="news.newType" style="width: 30%;height: 15px;">行业新闻
						</span>
					</c:if>
					</td>
				</tr>				
				<tr height="40px">
					<th style="font-size: 14px;">
						发布时间：
					</th>
					<td>
						<span  style="font-size: 12px;">
							<input placeholder="*请选择日期" type="text" value="${news.newTime }" id="newTime" name="news.newTime">
						</span>
					</td>
				</tr>
				<tr>
					<th style="font-size: 14px;">
						新闻详情：
					</th>
					<td colspan="3">
						<input placeholder="*请输入新闻详情" name="news.newContent"  value="${news.newContent }" style="width: 100%;height: 80px;">
					</td>
				</tr>
				<tr height="40px">
					<th colspan="2" width="50%">
			       		<div style="width:50%;margin-left: 25%;">
							<button type="button" onclick="document.getElementById('ff').submit()" id="editPersonalInfo" class="btn btn-primary btn-lg btn-block">
								保存
							</button>
						</div>
					</th>
					<th colspan="2">
						<div style="width:50%;margin-left: 25%;">
							<button type="button" id="Cancel" class="btn btn-danger btn-lg btn-block">
								取消
							</button>
						</div>
					</th>
				</tr>
				</table>
			</form>
		</div>
	</body>
</html>